<?php

$app->group(['prefix' => 'v1', 'namespace' => 'V1', 'middleware' => ['sign', 'api_cros', 'analysis']], function ($app) {



    /**
     *  Sms API (短信)
     */
    $app->group(['prefix' => 'sms'], function ($app) {
        //注册短信验证码
        $app->post('getcode',['middleware' => ['validate:Sms'],'uses' => 'SmsController@SendCode']);
        //忘记密码发送短信验证码
        $app->post('getPwdCode',['middleware' => ['validate:Sms'],'uses' => 'SmsController@getPwdCode']);

    });


    //注册
    $app->group(['prefix' => 'register'], function ($app) {
        //注册
        $app->post('register', ['middleware' => ['validate:Register'],'uses' => 'QuickController@register']);

    });

    //首页banner
    $app->group(['prefix' => 'banner'], function ($app) {
        //注册
        $app->post('getBanner', ['uses' => 'BannerController@getBanner']);

    });

    //首页banner
    $app->group(['prefix' => 'rank'], function ($app) {
        //注册
        $app->post('rank', ['uses' => 'RankController@rank']);

    });

    //获取钱包
    $app->group(['prefix' => 'wallet'], function ($app) {
        //注册
        $app->post('wallet', ['uses' => 'WalletController@wallet']);

    });

    //获取钱包
    $app->group(['prefix' => 'customer'], function ($app) {
        //注册
        $app->post('getCustomer', ['uses' => 'CustomerController@getCustomer']);

    });


    //获取行情
    $app->group(['prefix' => 'coin'], function ($app) {
        //注册
        $app->post('getCoin', ['uses' => 'CoinController@getCoin']);
        //存入币
        $app->post('storeCoin', ['middleware' => ['kk_token','validate:StoreCoin'],'uses' => 'CoinController@storeCoin']);
        //确认存入币
        $app->post('confirmStore', ['middleware' => ['kk_token'],'uses' => 'CoinController@confirmStore']);
        //存币记录
        $app->post('storeList', ['middleware' => ['kk_token'],'uses' => 'CoinController@storeList']);
        //提币
        $app->post('drawCoin', ['middleware' => ['kk_token','validate:DrawCoin'],'uses' => 'CoinController@drawCoin']);
        //确认提币
        $app->post('confirmDraw', ['middleware' => ['kk_token'],'uses' => 'CoinController@confirmDraw']);
        //提取币记录
        $app->post('drawList', ['middleware' => ['kk_token'],'uses' => 'CoinController@drawList']);
        //以太坊换ABC
        $app->post('exchange', ['middleware' => ['kk_token'],'uses' => 'CoinController@exchange']);


    });


    //收益
    $app->group(['prefix' => 'profit'], function ($app) {
        //
        $app->post('profit', ['middleware' => ['kk_token'],'uses' => 'ProfitController@profit']);
        //总收益
        $app->post('profitTotal', ['middleware' => ['kk_token'],'uses' => 'ProfitController@profitTotal']);

    });



    //账号密码登录
    $app->group(['prefix' => 'login'], function ($app) {

        $app->post('login', ['middleware' => ['validate:Login'], 'uses' => 'LoginController@login']);
        //实名认证
        $app->post('renzheng', [ 'middleware' => ['kk_token','validate:RenZheng'],'uses' => 'LoginController@renzheng']);
        //签到
        $app->post('sign', [ 'middleware' => ['kk_token'],'uses' => 'LoginController@sign']);


    });




    //设置新密码
    $app->group(['prefix' => 'person'], function ($app) {
        //忘记密码验证setPassword
        $app->post('testCode', ['middleware' => ['validate:TestPassword'], 'uses' => 'PasswordController@testCode']);
        //忘记密码验证
        $app->post('setPassword', ['middleware' => ['kk_token','validate:SetPassword'], 'uses' => 'PasswordController@setPassword']);
        //忘记密码验证
        $app->post('setTrPassword', ['middleware' => ['kk_token','validate:SetTrPassword'], 'uses' => 'PasswordController@setTrPassword']);

    });


    //交易信息
    $app->group(['prefix' => 'query'], function ($app) {
        //
        $app->post('query', ['middleware' => ['kk_token'],'uses' => 'QueryController@query']);


    });

    //交易信息
    $app->group(['prefix' => 'pay'], function ($app) {
        //
        $app->post('pay', ['middleware' => ['kk_token'],'uses' => 'PayController@pay']);

    });


    //申请成为卖家
    $app->group(['prefix' => 'apply'], function ($app) {
        //
        $app->post('apply', ['middleware' => ['kk_token'],'uses' => 'ApplyController@apply']);

    });


    //申请成为卖家
    $app->group(['prefix' => 'send'], function ($app) {
        //
        $app->post('getSend', ['uses' => 'SendController@getSend']);

    });

    $app->group(['prefix' => 'order'], function ($app) {
        //
        $app->post('addOrder', ['middleware' => ['kk_token'],'uses' => 'OrderController@addOrder']);

    });

    $app->group(['prefix' => 'order'], function ($app) {
        //
        $app->post('getOrder', ['middleware' => ['kk_token'],'uses' => 'OrderController@getOrder']);

    });

});

